#:kivy 1.0
#KV language
<LoginScreen>:
    name: 'login'
    BoxLayout:
        orientation: 'vertical'
        padding: dp(10),dp(280)
        spacing: dp(20)
        #Adding a Background to a Layout
        canvas.before:
            Color:
                rgba: 15/255., 109/255., 238/255., 1
            Rectangle:
                pos: self.pos
                size: self.size
        GridLayout:
            cols: 2
            size_hint: None,None
            width: root.width-100
            height: self.minimum_height
            padding: dp(10),0
            spacing: dp(15)
            row_force_default: True
            row_default_height: username.minimum_height
            Label:
                text:'User Name'
            TextInput:
                id: username
                multiline: False
                text: 'hacky'
            Label:
                text: 'Password'
            TextInput:
                id: password
                password: True
                multiline: False
                text: '123'
        MyButton:
            text: 'Login'
            padding:dp(85),dp(10)
            on_press: root.login(self)

<CircleScreen>:
    name: 'circle'
    BoxLayout:
        orientation: 'vertical'
        canvas.before:
            Color:
                rgba: 20/255., 115/255., 238/255., 1
            Rectangle:
                pos: self.pos
                size: self.size
        BoxLayout:
            size_hint_y: None
            height: sp(100)
            BoxLayout:
                orientation: 'vertical'
                Slider:
                    id: e1
                    min: -360.
                    max: 360.
                Label:
                    text: 'angle_start: {:.2f}'.format(e1.value)
            BoxLayout:
                orientation: 'vertical'
                Slider:
                    id: e2
                    min: -360.
                    max: 360.
                    value: 360
                Label:
                    text: 'angle_end: {:.2f}'.format(e2.value)
        BoxLayout:
            size_hint_y: None
            height: sp(100)
            BoxLayout:
                orientation: 'vertical'
                Slider:
                    id: wm
                    min: 0
                    max: 2
                    value: 1
                Label:
                    text: 'Width mult: {:.3f}'.format(wm.value)
            BoxLayout:
                orientation: 'vertical'
                Slider:
                    id: hm
                    min: 0
                    max: 2
                    value: 1
                Label:
                    text: 'Height mult: {:.3f}'.format(hm.value)
        BoxLayout:
            size_hint_y: None
            height: sp(100)
            padding: sp(30)
            spacing: sp(20)
            MyButton:
                text: 'Reset'
                font_size: '15sp'
                on_press: wm.value = 1; hm.value = 1;e1.value = 0; e2.value = 360
            MyButton:
                text: 'Return'
                font_size: '15sp'
                on_press: root.manager.current = 'login'
        FloatLayout:
            canvas:
                Color:
                    rgb: 1, 1, 1
                Ellipse:
                    pos: 100, 100
                    size: 200 * wm.value, 201 * hm.value
                    source: 'kivy-icon-512.png'
                    angle_start: e1.value
                    angle_end: e2.value

<MyPopup>:
	title: 'Info'
	size_hint: None,None
	size: dp(300),dp(200)
	auto_dismiss: False
	BoxLayout:
		orientation: 'vertical'
		padding: dp(20)
		Label:
			text: 'Username or Password is wrong'
			color: 255,0,0,1
		MyButton:
			text: 'Close'
			on_press: root.dismiss()

<MyButton@Button>:
    font_size: '20sp'
    size_hint:None,None
    size:self.texture_size
    pos_hint:{'center_x':.5,'center_y':.5}
    padding:dp(20),dp(10)
    background_color: [48/255.,117/255.,26/255.,0.5]